package main

import "fmt"

// func calculatePriceAfterDicount(price float64, discountrate float64) float64 {
// 	fmt.Println("Memeory location of price in calculatePriceAfterDicount fn:", &price)
// 	newPrice := price - (price * discountrate)
// 	return newPrice
// }

func applyDiscount(price *float64, discountrate float64) {
	*price = *price - (*price * discountrate)
}

func main() {
	var coffeePrice float64 = 5.00
	fmt.Println("Memeory location of coffePrice in main fn:", &coffeePrice)
	var discount float64 = 0.10
	fmt.Printf("Basic coffee price:%.2f\n", coffeePrice)
	// coffeePrice = calculatePriceAfterDicount(coffeePrice, discount)
	applyDiscount(&coffeePrice, discount)
	fmt.Printf("Price with discount:%.2f\n", coffeePrice)
}
